home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Enigma / 116066.jar / c.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-06-13  |  3.1 KB  |  179 lines

  1. import example.formike.ForMikeMIDlet;
  2. import javax.microedition.lcdui.Canvas;
  3. import javax.microedition.lcdui.Command;
  4. import javax.microedition.lcdui.CommandListener;
  5. import javax.microedition.lcdui.Display;
  6. import javax.microedition.lcdui.Displayable;
  7. import javax.microedition.lcdui.Graphics;
  8.  
  9. // $FF: renamed from: c
  10. public class class_0 extends Canvas implements CommandListener, Runnable {
  11.    // $FF: renamed from: q int
  12.    public int field_0 = 10;
  13.    // $FF: renamed from: h example.formike.ForMikeMIDlet
  14.    public final ForMikeMIDlet field_1;
  15.    // $FF: renamed from: p boolean
  16.    public final boolean field_2;
  17.    // $FF: renamed from: g javax.microedition.lcdui.Command
  18.    public final Command field_3;
  19.    // $FF: renamed from: o java.lang.Thread
  20.    public volatile Thread field_4 = null;
  21.    // $FF: renamed from: n d
  22.    public final d field_5;
  23.    // $FF: renamed from: m int
  24.    public int field_6 = ((Canvas)this).getWidth();
  25.    // $FF: renamed from: l int
  26.    public int field_7 = ((Canvas)this).getHeight();
  27.    // $FF: renamed from: k int
  28.    public int field_8 = 1;
  29.  
  30.    // $FF: renamed from: c () void
  31.    public final void method_0() {
  32.       this.field_1.c();
  33.    }
  34.  
  35.    public final void showNotify() {
  36.       if (this.field_5 != null) {
  37.          this.field_5.af();
  38.       }
  39.  
  40.    }
  41.  
  42.    public class_0(ForMikeMIDlet var1, Display var2) {
  43.       this.field_1 = var1;
  44.       this.field_2 = var2.isColor();
  45.       this.field_5 = new d(this.field_2, this);
  46.       ((Displayable)this).setCommandListener(this);
  47.       this.field_3 = new Command("Exit", 7, 1);
  48.       ((Displayable)this).addCommand(this.field_3);
  49.    }
  50.  
  51.    public final void commandAction(Command var1, Displayable var2) {
  52.       if (var1 == this.field_3) {
  53.          this.field_1.b();
  54.       }
  55.  
  56.    }
  57.  
  58.    // $FF: renamed from: e () void
  59.    public final synchronized void method_1() {
  60.       this.field_4 = new Thread(this);
  61.       this.field_4.start();
  62.       this.field_5.ag(1);
  63.    }
  64.  
  65.    // $FF: renamed from: d () void
  66.    public final synchronized void method_2() {
  67.       this.field_4 = null;
  68.    }
  69.  
  70.    public final void run() {
  71.       Thread var1 = Thread.currentThread();
  72.  
  73.       try {
  74.          while(var1 == this.field_4) {
  75.             long var2 = System.currentTimeMillis();
  76.             ((Canvas)this).repaint(0, 0, ((Canvas)this).getWidth(), ((Canvas)this).getHeight());
  77.             long var4 = System.currentTimeMillis() - var2;
  78.             if (var4 < (long)this.field_0) {
  79.                synchronized(this){}
  80.  
  81.                try {
  82.                   this.wait((long)this.field_0 - var4);
  83.                } catch (Throwable var10) {
  84.                   throw var10;
  85.                }
  86.             }
  87.          }
  88.       } catch (InterruptedException var11) {
  89.       } catch (Exception var12) {
  90.       }
  91.  
  92.    }
  93.  
  94.    public final void paint(Graphics var1) {
  95.       try {
  96.          if (this.field_8 != -1) {
  97.             var1.translate(-var1.getTranslateX(), -var1.getTranslateY());
  98.             var1.setColor(this.field_8 * -1);
  99.             var1.fillRect(0, 0, this.field_6, this.field_7);
  100.             var1.setColor(0);
  101.             this.field_8 = -1;
  102.          }
  103.  
  104.          var1.translate((this.field_6 - 101 >> 1) - var1.getTranslateX(), (this.field_7 - 80 >> 1) - var1.getTranslateY());
  105.          this.field_5.ad(var1);
  106.       } catch (Exception var3) {
  107.       }
  108.  
  109.    }
  110.  
  111.    public final void keyPressed(int var1) {
  112.       try {
  113.          switch (var1) {
  114.             case 42:
  115.                this.field_5.ac();
  116.                break;
  117.             case 43:
  118.             case 44:
  119.             case 45:
  120.             case 46:
  121.             case 47:
  122.             case 48:
  123.             default:
  124.                int var2 = ((Canvas)this).getGameAction(var1);
  125.                switch (var2) {
  126.                   case 1:
  127.                      this.field_5.k();
  128.                      return;
  129.                   case 2:
  130.                      this.field_5.m();
  131.                      return;
  132.                   case 3:
  133.                   case 4:
  134.                   case 7:
  135.                   default:
  136.                      return;
  137.                   case 5:
  138.                      this.field_5.l();
  139.                      return;
  140.                   case 6:
  141.                      this.field_5.j();
  142.                      return;
  143.                   case 8:
  144.                      this.field_5.n();
  145.                      return;
  146.                }
  147.             case 49:
  148.                this.field_5.h();
  149.                break;
  150.             case 50:
  151.                this.field_5.k();
  152.                break;
  153.             case 51:
  154.                this.field_5.i();
  155.                break;
  156.             case 52:
  157.                this.field_5.m();
  158.                break;
  159.             case 53:
  160.                this.field_5.n();
  161.                break;
  162.             case 54:
  163.                this.field_5.l();
  164.                break;
  165.             case 55:
  166.                this.field_5.h();
  167.                break;
  168.             case 56:
  169.                this.field_5.j();
  170.                break;
  171.             case 57:
  172.                this.field_5.i();
  173.          }
  174.       } catch (Exception var3) {
  175.       }
  176.  
  177.    }
  178. }
  179.